import { configureStore } from '@reduxjs/toolkit';
import type { TypedUseSelectorHook } from 'react-redux';
import { useSelector } from 'react-redux';
import { loginEntSlice } from './toolkitSlice/LoginEntSlice';
import { loginUserSlice } from './toolkitSlice/LoginUserSlice';
import { microAppSlice } from './toolkitSlice/MicroAppSlice';
import { commonDataSlice } from './toolkitSlice/CommonDataSlice';
export const store = configureStore({
  reducer: {
    loginUser: loginUserSlice.reducer,
    loginEnt: loginEntSlice.reducer,
    microAppStore: microAppSlice.reducer,
    commonData: commonDataSlice.reducer,
  },
  middleware: (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: false }),
});

export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;

export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
